<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>捐赠记录</title>
    <link rel="stylesheet" type="text/css" href="__CSS__api.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__aui.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__dropload.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__common.css" />

    <style>
        .aui-bar-nav .aui-iconfont {
            position: relative;
            font-family: "aui_iconfont" !important;
            font-size: 0.75rem;
            color: #E73C5C;
            font-style: normal;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            height: 2.4rem;

        }

        .aui-bar-nav {
            background-color: #fff;
        }

        .aui-icon-tu {
            height: 2.4rem;
            width: 49px;
            background: url('__IMG__left.png') no-repeat 0.5rem center;
            background-size: 22px 22px;
        }

        .aui-bar-nav .aui-pull-right {
            padding-right: 0.75rem;
        }

        .aui-bar-nav .aui-title {
            font-size: 0.9rem;
            color: #333333;
            font-weight: 500;
        }
        body{
            background-color: #F5F5F5;
        }
        .warrp{
            padding: 0 0.75rem 0 0.8rem;
            background-color: #FFFFFF;
        }
        .box{
            width: 100%;
            height: 3.25rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .title{
            font-size:0.8rem;
            font-weight: bold;
            line-height:0.6rem;
            color: #333333;
        }
        .content{
            font-size:0.7rem;
            line-height:0.6rem;
            color: #999999;
        }
    </style>
</head>

<body>
<header class="aui-bar aui-bar-nav underLine" style="padding-top:25px;z-index:10000;" id="header">
    <a class="aui-pull-left" tapmode="active" onclick="history.go(-1);"> <span class="aui-iconfont aui-icon-tu"> </span> </a>
    <div class="aui-title" style="font-size0.8rem;font-weight:bold">捐赠记录</div>
</header>
<div class="upOrDown">
    <div class="upOrDown_data">
        <div class="warrp">
            <!--<div class="box underLine" onclick="fnJuan()" tapmode='active'>-->
                <!--<div class="title">-->
                    <!--捐赠-->
                <!--</div>-->
                <!--<div class="content">-->
                    <!--2017-12-33-->
                <!--</div>-->
            <!--</div>-->
            <!--<div class="box underLine">-->
                <!--<div class="title">-->
                    <!--捐赠-->
                <!--</div>-->
                <!--<div class="content">-->
                    <!--2017-12-33-->
                <!--</div>-->
            <!--</div>-->
            <!--<div class="box">-->
                <!--<div class="title">-->
                    <!--捐赠-->
                <!--</div>-->
                <!--<div class="content">-->
                    <!--2017-12-33-->
                <!--</div>-->
            <!--</div>-->
        </div>
    </div>
</div>

</body>
<script type="text/javascript" src="__JS__jquery.min.js"></script>
<script type="text/javascript" src="__JS__layer_mobile/layer.js"></script>
<script type="text/javascript" src="__JS__dropload.min.js"></script>
<script type="text/javascript" src="__JS__api.js"></script>
<script type="text/javascript" src="__JS__tt.js"></script>
<script type="text/javascript">
    // // 打开某条列表详情
function fnJuan(id) {
    location.href='{:url("my/donation_recordlist_detail")}?donate_id='+id;

}
var page = 0;
/**
 * 上拉加载，下拉刷新
 */
var dropload = $('.upOrDown').dropload({
    scrollArea : window,
    autoLoad : true,
    // domUp : {
    //     domClass   : 'dropload-up',
    //     domRefresh : '<div class="dropload-refresh">↓下拉刷新-自定义内容</div>',
    //     domUpdate  : '<div class="dropload-update">↑释放更新-自定义内容</div>',
    //     domLoad    : '<div class="dropload-load"><span class="loading"></span>加载中-自定义内容...</div>'
    // },
    // domDown : {
    //     domClass   : 'dropload-down',
    //     domRefresh : '<div class="dropload-refresh">刷新</div>',
    //     domLoad    : '<div class="dropload-load"><span class="loading"></span>加载中...</div>',
    //     domNoData  : '<div class="dropload-noData">无数据</div>'
    // },
    loadDownFn : function(me){
        page++;
        console.log('page='+page);

        $.ajax({
            url:'{:url("My/donateList")}',
            data:'page='+page,
            type:'POST',
            dataType:'JSON',
            success: function(data){
                var arrLen = data.msg.length;
                if(arrLen<=0){
                    me.lock();
//                         无数据
                    me.noData(true);
                    // 每次数据加载完，必须重置
                    me.resetload();
                }else{
                    datatolist(data.msg);
//                        $('.upOrDown_data').append(data);
                    // 每次数据加载完，必须重置
                    me.resetload();
                }

            },
            error: function(xhr, type){
                // 即使加载出错，也得重置
                me.resetload();
            }
        });
    },
    loadUpFn : function(me){
        page = 1;
        $.ajax({
            url:'{:url("My/donateList")}',
            data:'page='+page,
            type:'POST',
            dataType:'json',
            success: function(data){
                $('.warrp').empty();//
                var datas = data.msg;
                datatolist(datas);
                me.resetload();
                me.unlock();
                me.noData(false);
                // $('.cooc').click(function () {
                //     var id = $(this).attr('id');
                //     location.href = '{:url("First/activitydatail")}?activity_id='+id;
                // });
            },
            error: function(xhr, type){
                // alert('Ajax error!');
                me.resetload();
            }
        });
    }
});
function getdata() {
    $.ajax({
        url:'{:url("My/myOrderList")}',
        data:'page='+page,//
        type:'POST',
        dataType:'JSON',
        success: function(data){
            if (data.length>0) {
                // datatolist(data);
            }else {

            }
        },
        error: function(xhr, type){
            alert('Ajax error!');
            // 即使加载出错，也得重置

        }
    });

}


// 数据列表化
function datatolist(data) {
    var html='';
    for (var i=0;i<data.length;i++) {
        html+='<div class="box underLine" onclick="fnJuan('+data[i].donate_id+')">';
        if (data[i].cate==2) {
            html+='<div class="title">打赏</div>';

        }else if (data[i].cate==1) {
            html+='<div class="title">捐赠</div>';

         } else {
            html+='<div class="title">其他</div>';

        }
        html+='<div class="content">'+data[i].pay_time+'</div>';
        html+='</div>';
    }
    $(".warrp").append(html);
}

</script>

</html>
